<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script type="text/javascript" src="/js/plugins/jquery/jquery.min.js"></script>
</head>
<body>
<h1 id="msg">正在跳转支付请稍后....10s</h1>
<script>
  $(function () {
     var time = 10;
    var daojishi = setInterval(function () { //倒计时函数
      if (time <= 0 ){
        clearInterval(daojishi)
        getOrder();
      }else {
        $("#msg").text("正在跳转支付请稍后...."+time--+"s");
      }
    },1000)
  })

  function getOrder() {
    $.get("/seckill/getOrderId",{},function (result) {
        if (result.code == 10000){
            alert("跳转支付")
            alert(result.data)
        }else if (result.code==10007){
            alert(data.message);
            location.href="toLogin";
        }else {
            alert(result.data);
        }
    })
  }
</script>
</body>
</html>